Triggers do not run

Hello,
I defined several triggers in different levels for all the modules in the project. The purpose is to check the inputs of the users for the attributes. For example a user has to enter a qualification method for the object marked as requirement.
For some reason I had to delete all the triggers in the project. I know how to define them again.
I recovered some of them but some others are not triggered.
I am using absolutely the same code. But they are not triggered. They seem to be defined with correct dxl code. But when I changed the related attribute nothing happens. No error code. I put several printfs, but got no response. I delete them all, redefined, exited DOORS, logged in again. Nothing changes.

I think DOORS have some bugs in triggers. Why I had to delete all the triggers is because I cannot delete one of them. It didn't seem to be defined (when I listed all of them) but it was working, so I had to delete all them.
Now I can't define all them. :-)

Any ideas?
Thanks
Özgür
ozgury - Mon Jun 15 05:18:55 EDT 2009

Re: Triggers do not run
Peter_Albert - Mon Jun 15 05:53:15 EDT 2009

Hi Özgür,

calm down :-) Triggers are not easy to work with, especially not if you are upset already. As there are countless possible reasons why a trigger does not work (or at least not in the way you expect it to), it is hard to tell why things do not work out properly in your case. But at least for one problem I can provide some help. It is in deed possible to delete individual triggers. Just run the attached script in a formal module where you expect a trigger to be defined. You will get a list of all triggers, and by putting the name of one of them in the text field and hitting return, you will delete this very trigger. And the script will of course tell you whether the trigger you thought you defined actually exists.

Regards,

Peter
Attachments

attachment_14262271_triggers.dxl

Re: Triggers do not run
ozgury - Mon Jun 15 08:46:50 EDT 2009

Peter_Albert - Mon Jun 15 05:53:15 EDT 2009
Hi Özgür,

calm down :-) Triggers are not easy to work with, especially not if you are upset already. As there are countless possible reasons why a trigger does not work (or at least not in the way you expect it to), it is hard to tell why things do not work out properly in your case. But at least for one problem I can provide some help. It is in deed possible to delete individual triggers. Just run the attached script in a formal module where you expect a trigger to be defined. You will get a list of all triggers, and by putting the name of one of them in the text field and hitting return, you will delete this very trigger. And the script will of course tell you whether the trigger you thought you defined actually exists.

Regards,

Peter

Hi Peter,
Thank you for the script. It is nice to have an interface. I was doing that work very primitive. It will make things easier.
But I still cannot define triggers. Actually I define them but they are not triggered. So what I did is I created a module from the template (same trigger code runs perfectly when creating a module from a template!) and copied all the objects, links and views, not one by one of course, by using scripts that come with DOORS.
This method worked because our project is just beginning and modules (only 2) did not have baselines. I hope I don't face this problem again.
Thank you for the help.
I am calmer now. :-)

Regards,
Özgür

Re: Triggers do not run
llandale - Mon Jun 15 10:41:54 EDT 2009

You can write scripts to find and delete triggers, as the other poster noted. Never-the-less, each of your set-trigger DXL should have the capability of removing itself. They look something like this:
string DxlCode = "//this is what I want the trigger to do
infoBox(\"Hello from trigger code\")
" // end DxlCode.

string ErrMess = checkDXL(DxlCode)
if (!null ErrMess)
{ errorBox("Error in DXL Code: " ErrMess)
halt
}

string NameTrig = "MyTriggerName"
Trigger trg
if (confirm("Delete Trigger " NameTrig "??"))
delete(NameTrig, bla bla bla)
elseif(confim("Create Trigger " NameTrig "??"))
{ trg = trigger(NameTrig, bla bla bla)
if (null trg) errorBox("Trigger did not take " NameTrig)
}
{code}
  • Louie

Re: Triggers do not run
llandale - Mon Jun 15 10:52:11 EDT 2009

Peter_Albert - Mon Jun 15 05:53:15 EDT 2009
Hi Özgür,

calm down :-) Triggers are not easy to work with, especially not if you are upset already. As there are countless possible reasons why a trigger does not work (or at least not in the way you expect it to), it is hard to tell why things do not work out properly in your case. But at least for one problem I can provide some help. It is in deed possible to delete individual triggers. Just run the attached script in a formal module where you expect a trigger to be defined. You will get a list of all triggers, and by putting the name of one of them in the text field and hitting return, you will delete this very trigger. And the script will of course tell you whether the trigger you thought you defined actually exists.

Regards,

Peter

Wrote a similar script with intend on finding all triggers that may be affecting a given module. The trig in Project loop will find triggers housed in currently open modules, so I had to figure out how to suppressing finding triggers twice. The trig in Project loop does NOT find triggers housed in parent Projects, but these triggers do affect modules. The 'stored' command doesn't work quite right, but I don't recall the details. Don't you think you should PROMPT to delete each trigger, with an option to stop the loop?

  • Louie

Re: Triggers do not run
Peter_Albert - Tue Jun 16 03:39:10 EDT 2009

llandale - Mon Jun 15 10:52:11 EDT 2009
Wrote a similar script with intend on finding all triggers that may be affecting a given module. The trig in Project loop will find triggers housed in currently open modules, so I had to figure out how to suppressing finding triggers twice. The trig in Project loop does NOT find triggers housed in parent Projects, but these triggers do affect modules. The 'stored' command doesn't work quite right, but I don't recall the details. Don't you think you should PROMPT to delete each trigger, with an option to stop the loop?

  • Louie

Hi Louie,

you are right, the script is quite dangerous as it was by silently deleting all triggers. My apologies if that created trouble for somebody already. I wrote it quite a while ago when I started experimenting with triggers, and by that time deleting all triggers was o.k. for me.

I have added a query box for each trigger with the option to cancel the loop in the attached updated script.

Peter
Attachments

attachment_14262826_triggers.dxl